﻿@using CoreData
@using Helper
@model IEnumerable<CoreData.CustomerIdea>
@if (Model != null && Model.Count() > 0)
{
    var htmlid = "tSortablecustomeridea" + Model.First().Type;
    var i = 0;
    <table cellpadding="0" cellspacing="0" width="100%" class="table" id="@htmlid">
        <thead>
            <tr>
                <th width="20px">
                    
                </th>
                <th width="70px">
                    Sender
                </th>
               
                <th width="75px">
                    Attachment
                </th>
                <th width="60px">
                    Email
                </th>
                <th width="60px">
                    Send date
                </th>
               <th width="60px">
                    View
                </th>
                <th width="60px">
                    Action
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                i++;
                <tr>
                    <td width="20px">
                        @i
                        <span class="SpanId" style="display: none;">@item.ID</span>
                    </td>
                    <td width="70px">
                        @item.UserNameExt
                    </td>
                   
                    <td width="60px">
                        @item.Attachment
                    </td>
                    <td width="60px">
                        @item.Email
                    </td>
                    <td width="60px">
                        @item.DateCreate
                    </td>
                  <td width="60px">
                    @if (item.IsView)
                    {
                         <span class="orderlabel new-order" >Yes</span>
                    }
                    else
                    { 
                        <span class="orderlabel complete-order" >No</span> 
                    }
                    </td>
                    <td width="60px">
                        @if (Helper.SessionManagement.Value("pvalue").Contains("D"))
                        {
                            <a title="Detete" href="@Url.Action("Delete", "CustomerIdeaManager", new { id = item.ID })" class="icon-trash" onclick="return confirm('Do you want delete ?');">
                            </a>
                        }
                        @if (Helper.SessionManagement.Value("pvalue").Contains("R"))
                        {
                            <a title="View" href="@Url.Action("Detail", "CustomerIdeaManager", new { id = item.ID })" class="icon-eye-open">
                            </a>
                        }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <h2 class="error-text">
       
    </h2>
}